package com.fxl.majiang.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author fengxinglei
 * @date 2022/8/7 10:46
 * @description 操作优先级枚举,order值越小越优先
 */
@AllArgsConstructor
@Getter
public enum OperationOrderEnum {
    CHI(OperationEnum.CHI, 100),
    PENG(OperationEnum.PENG, 90),
    MING_GANG_IT(OperationEnum.MING_GANG_IT, 80),
    DIAN_PAO(OperationEnum.DIAN_PAO, -100),
    GIVE_UP_OPERATION(OperationEnum.GIVE_UP_OPERATION, 0);

    private OperationEnum operation;

    private int order;

    public static int getOrder(OperationEnum operation) {
        for (OperationOrderEnum _enum : values()) {
            if (_enum.getOperation() == operation) {
                return _enum.getOrder();
            }

        }
        return 0;
    }
}
